<template>
	<view class="mainpadding">
		<view class="ffffff radius mainpadding">
			<view class="flexbetween margin_top">
				<image class="sptp" :src="dataAll.goods.image_text" mode=""></image>
				<view class="" style="width: 77%;">
					<view class="ershiba xiaohei yhxk">{{dataAll.goods.title}}</view>
					<view class="titletext xiaocheng margin_top4">¥98.00</view>
				</view>
			</view>
		</view>
		<!-- 未拼团 -->
		<view class="ffffff radius mainpadding margin_top">
			<view class="flexcenter">
				<view class="titletext zhonghei fonweight">仅差</view>
				<view class="titletext xiaocheng fonweight">{{Number(dataAll.pt_num) - dataAll.groupuser.length}}</view>
				<view class="titletext zhonghei fonweight">人，即可拼单成功！</view>
			</view>
			<view class="flexcenter flex_wrap">
				<image class="touxiag margin_right3 margin_top" v-for="item in dataAll.groupuser" :key="item.id" :src="item.user.avatar_text" mode=""></image>
				<image class="touxiag margin_right3 margin_top" src="../static/images/system/pttx.png" mode="" v-for="(item,index) in Number(dataAll.pt_num) - dataAll.groupuser.length"></image>
			</view>
			<button open-type="share" hover-class="none" v-if="!sharetrue">
				<view class="bigbtn margin_top5">一键拼单</view>
			</button>
			<view class="bigbtn margin_top5" v-if="sharetrue" @click="tzspxq(dataAll.goods.id,dataAll.goods.goods_attr)">立即拼单</view>
		</view>
		<!-- 拼团成功 -->
		<!-- <view class="ffffff radius mainpadding margin_top">
			<view class="flexcenter">
				<view class="titletext zhonghei fonweight">拼团已成功！</view>
			</view>
			<view class="flexcenter margin_top">
				<image v-for="item in 3" class="touxiag margin_right3" src="../static/images/system/dh.png" mode="">
				</image>
			</view>
		</view> -->
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				dataAll: {},
				listid:"",
				sharetrue:false
			}
		},
		onLoad(options) {
			this.listid = options.id
			if(options.code){
				this.sharetrue = true
				uni.setStorageSync("invite_code",options.code)
			}
			this.getDetail()
		},
		onShareAppMessage() {
			let _this = this
			return {
				title: "喜嘟来",
				path: "pages_shouye/pindanxq?code=" + uni.getStorageSync("myinvite_code")+"&id="+_this.listid,
			}
		},
		methods: {
			tzspxq(id, attr) {
				uni.navigateTo({
					url: '/pages_lianmengsc/shangpxq?id=' + id + "&attr=" + attr + "&ptid=" + this.listid
				})
			},
			getDetail() {
				httpRequest.request('/api/goodscl/wanlshopGroupDetail', 'GET', {
					id: this.listid
				}, false, false, false).then(res => {
					this.pageShow = true
					this.dataAll = res.data
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.touxiag {
		width: 106rpx;
		height: 106rpx;
		border-radius: 50%;
	}

	.sptp {
		width: 124rpx;
		height: 124rpx;
		border-radius: 10rpx;
	}
</style>